package com.tanhua.model.vo;

import com.tanhua.model.domain.Dimensions;
import com.tanhua.model.domain.Questions;
import com.tanhua.model.domain.Report;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author pc
 * @date 2021/11/28
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ReportVo {

    private String conclusion;
    private String cover;
    private List<Dimensions> dimensions;
    private List<SimilarYouVo> similarYou;

    public static ReportVo init(Report report) {
        Integer dimensions = report.getDimensions();
        List<Dimensions> list = new ArrayList<>();
        if (dimensions == 1) {
            list.add(new Dimensions("内向", "75%"));
            list.add(new Dimensions("判断", "80%"));
            list.add(new Dimensions("可靠", "60%"));
            list.add(new Dimensions("理性", "75%"));
        } else if (dimensions == 2) {
            list.add(new Dimensions("稳定", "70%"));
            list.add(new Dimensions("友善", "75%"));
            list.add(new Dimensions("耐心", "80%"));
            list.add(new Dimensions("可靠", "80%"));

        } else if (dimensions == 3) {
            list.add(new Dimensions("外向", "70%"));
            list.add(new Dimensions("自信", "75%"));
            list.add(new Dimensions("乐观", "80%"));
            list.add(new Dimensions("热情", "60%"));

        } else {
            list.add(new Dimensions("外向", "80%"));
            list.add(new Dimensions("自信", "85%"));
            list.add(new Dimensions("果断", "80%"));
            list.add(new Dimensions("强势", "90%"));
        }
        ReportVo vo = new ReportVo();
        vo.setConclusion(report.getConclusion());
        vo.setCover(report.getCover());
        vo.setDimensions(list);
        return vo;
    }
}
